var __extends =
    (this && this.__extends) ||
    (function () {
      var e = function (t, i) {
        return (e =
          Object.setPrototypeOf ||
          ({ __proto__: [] } instanceof Array &&
            function (e, t) {
              e.__proto__ = t;
            }) ||
          function (e, t) {
            for (var i in t)
              Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
          })(t, i);
      };
      return function (t, i) {
        function a() {
          this.constructor = t;
        }
        if ("function" != typeof i && null !== i)
          throw new TypeError(
            "Class extends value " + String(i) + " is not a constructor or null"
          );
        e(t, i),
          (t.prototype =
            null === i
              ? Object.create(i)
              : ((a.prototype = i.prototype), new a()));
      };
    })(),
  HomePageView = (function (e) {
    function t(t) {
      var i = e.call(this) || this;
      return (
        (i.isAutoFight = !1),
        (i.totalMsgArray = []),
        (i.privateArray = []),
        (i.diaListArr = []),
        (i.taskArr = []),
        (i.onLoadPushMessageDataFn = {
          caller: i,
          code: 91,
          method: function (e) {
            FriendSeekDialog.showApplyMsgDialog(e.data);
          },
        }),
        (i.onLoadSystemMessageDataFn = {
          caller: i,
          code: 10,
          method: function (e) {
            var t = !1,
              a = !1,
              o = !1,
              n = !1;
            if ("1" == e.state) {
              for (s = 0; s < i.totalMsgArray.length; s++) {
                (l = i.totalMsgArray[s].state) != e.state || (t = !0);
              }
              0 == t && i.totalMsgArray.push(e);
            } else if ("2" == e.state)
              if (PrivateChatDialog.chatState)
                WebSocketService.send({ c: 1033, d: { roleid: e.info_id } });
              else {
                for (s = 0; s < i.totalMsgArray.length; s++) {
                  i.totalMsgArray[s].info_id != e.info_id || (o = !0);
                }
                0 == o && i.privateArray.push(e),
                  1 == i.privateArray.length &&
                    0 == o &&
                    i.totalMsgArray.push(e);
              }
            else if ("3" == e.state) {
              for (s = 0; s < i.totalMsgArray.length; s++) {
                (l = i.totalMsgArray[s].state) != e.state || (a = !0);
              }
              0 == a && i.totalMsgArray.push(e);
            } else if ("5" == e.state);
            else if ("6" == e.state) {
              for (var s = 0; s < i.totalMsgArray.length; s++) {
                var l = i.totalMsgArray[s].state;
                if (l == e.state) {
                  n = !0;
                  break;
                }
              }
              0 == n && i.totalMsgArray.push(e);
            }
            i.showSystemMessage(i.totalMsgArray);
          },
        }),
        (i.HomeDiagoListener = {
          caller: i,
          code: 200,
          method: function (e) {
            var t = [],
              a = e.npclist;
            a.length > 0 && (i.list_baseNav.visible = !0),
              (i.diaListArr = e.npclist);
            for (var o, n = "", s = 0; s < a.length; s++)
              (o = {
                id: a[s].id,
                name: a[s].name,
                typeId: a[s].typeId,
                baseNavLabel: { text: a[s].name },
              }),
                t.push(o),
                "副本使者" == a[s].name &&
                  ((Global.isFuBen = !0), (n = "副本使者"));
            "副本使者" == n
              ? ((i.list_task_tip_board.visible = !1),
                (i.btn_fun_renwu.visible = !1))
              : ((i.list_task_tip_board.visible = !0),
                (i.btn_fun_renwu.visible = !0)),
              (i.list_baseNav.array = t),
              (i.npcArr = []);
            for (s = 0; s < e.npclist.length; s++) {
              var l = e.npclist[s];
              1 == l.typeId && i.npcArr.push(l);
            }
            "roleFirst" == Global.roleFirst &&
              (i.beginnersJoinSanGuoAction(), (Global.roleFirst = ""));
          },
        }),
        (i.jixuNPCDialogFn = { caller: i, code: 120, method: function (e) {} }),
        (i.homeSuboardinateInfoListener = {
          caller: i,
          code: 320,
          method: function (e) {
            (i.image_fujiang_one.skin = ""),
              (i.image_fujiang_two.skin = ""),
              (i.image_fujiang_three.skin = "");
            for (var t = e.list.length, a = 0; a < t; a++) {
              var o = e.list[a].headImg;
              0 == a
                ? (i.image_fujiang_one.skin = "comp/fujiang/head_" + o + ".png")
                : 1 == a
                ? (i.image_fujiang_two.skin = "comp/fujiang/head_" + o + ".png")
                : 2 == a &&
                  (i.image_fujiang_three.skin =
                    "comp/fujiang/head_" + o + ".png");
            }
          },
        }),
        (i.dataSource = []),
        (i.sysArray = []),
        (i.roleId = t),
        i.myselfInfo.on(Laya.Event.CLICK, i, i.onMyselfInfoFn),
        i.btn_goldBrick.on(Laya.Event.CLICK, i, i.onGetJinValueAction),
        i.user_tlz_Label.on(Laya.Event.CLICK, i, i.onDidClickTiLiZhiAction),
        i.btn_xinshoulibao.on(Laya.Event.CLICK, i, i.onGetXinShouLiBaoAction),
        (i.list_baseNav.selectEnable = !0),
        i.list_baseNav.on(Laya.Event.CLICK, i, i.onBaseNavSelect),
        (i.list_baseNav.renderHandler = new Laya.Handler(
          i,
          i.updateBaseNavHandlerFn
        )),
        (i.list_baseNav.repeatY = 7),
        (i.list_system_message.visible = !1),
        (i.list_baseNav.visible = !1),
        (i.list_task_tip_board.vScrollBarSkin = ""),
        (i.list_task_tip_board.selectEnable = !0),
        i.list_task_tip_board.on(Laya.Event.CLICK, i, i.onTaskTipBoardData),
        i.image_fujiang_one.on(Laya.Event.CLICK, i, i.onLoadImageFuJiangAction),
        i.image_fujiang_two.on(Laya.Event.CLICK, i, i.onLoadImageFuJiangAction),
        i.image_fujiang_three.on(
          Laya.Event.CLICK,
          i,
          i.onLoadImageFuJiangAction
        ),
        WebSocketService.addListener({
          caller: i,
          code: 1e4,
          method: i.synReq,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 100,
          method: i.onLoadHomeInfoListener,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 300,
          method: i.baseInfoListener,
        }),
        WebSocketService.addListener(i.HomeDiagoListener),
        WebSocketService.addListener(i.homeSuboardinateInfoListener),
        WebSocketService.addListener(i.jixuNPCDialogFn),
        WebSocketService.addListener(i.onLoadSystemMessageDataFn),
        WebSocketService.addListener(i.onLoadPushMessageDataFn),
        WebSocketService.addListener({
          caller: i,
          code: 713,
          method: i.onLoadNPCDialogData,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 1451,
          method: i.onLoadMySelfMoney,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 1480,
          method: i.onLoadMySelfEstateData,
        }),
        WebSocketService.addListener(
          { caller: i, code: 1153, method: i.onLoadTaskListDetailData },
          !0
        ),
        WebSocketService.addListener(
          { caller: i, code: 1436, method: i.gotoDestination },
          !0
        ),
        WebSocketService.addListener(
          { caller: i, code: 1437, method: i.gotoDestination },
          !0
        ),
        WebSocketService.addListener({
          caller: i,
          code: 1425,
          method: i.onLoadXinShouLiBaoFn,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 6067,
          method: i.onLoadNewRoleUseAction,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 1904,
          method: i.onLoadUserTaoWaDataFn,
        }),
        WebSocketService.addListener({
          caller: i,
          code: 4210,
          method: i.onLoadGroupTeamDataFn,
        }),
        i.initSetPageView(),
        i.setupMapViewActionFn(),
        i.initFunPageView(),
        (i.list_system_message.renderHandler = new Handler(
          i,
          i.updateMessageRenderHandler
        )),
        (i.list_system_message.selectEnable = !0),
        i.list_system_message.on(
          Laya.Event.CLICK,
          i,
          i.onMessageDidClickAction
        ),
        Laya.stage.on("HomePageView", i, i.eventHandler),
        Laya.timer.loop(4e4, i, i.sycSite),
        i.image_map.on(Laya.Event.CLICK, i, i.onDidClickMapFn),
        i.btn_map_wei1.on(Laya.Event.CLICK, i, i.onMapDidClickWeiFn),
        i.btn_map_wei2.on(Laya.Event.CLICK, i, i.onMapDidClickWeiFn),
        i.btn_map_wei3.on(Laya.Event.CLICK, i, i.onMapDidClickWeiFn),
        i.btn_map_shu1.on(Laya.Event.CLICK, i, i.onMapDidClickShuFn),
        i.btn_map_shu2.on(Laya.Event.CLICK, i, i.onMapDidClickShuFn),
        i.btn_map_wu1.on(Laya.Event.CLICK, i, i.onMapDidClickWuFn),
        i.btn_map_wu2.on(Laya.Event.CLICK, i, i.onMapDidClickWuFn),
        i
      );
    }
    return (
      __extends(t, e),
      (t.open = function (e) {
        return (
          null == this.instance && (this.instance = new t(e)),
          (this.instance.roleId = e),
          (this.instance.isFirstComeIn = !0),
          (this.instance.isFuBenState = !1),
          MapCityAreaView.resetShow(),
          (this.instance.taskArr = []),
          (Global.isShowMarquee = !0),
          (Global.vipBag = 0),
          this.instance.initTaskDiv(),
          (this.instance.btn_xinshoulibao.visible = !1),
          (this.instance.image_xinshoulibao.visible = !1),
          this.instance.setupPersonTabView(),
          this.instance
        );
      }),
      (t.prototype.sycSite = function () {
        WebSocketService.send({ c: 100 });
      }),
      (t.prototype.onLoadNPCDialogData = function (e) {
        0 != e.code && ToastView.toastView(e.msg);
      }),
      (t.prototype.showSystemMessage = function (e, t) {
        var i = e;
        i.length > 0 && (this.list_system_message.visible = !0),
          (this.dataSource = []);
        for (var a, o = 0; o < i.length; o++)
          (a = {
            image_message_tip: { skin: this.dealSystemMessageState(i[o]) },
            state: i[o].state,
            info_id: i[o].info_id,
          }),
            this.dataSource.push(a);
        1 == this.dataSource.length
          ? (this.list_system_message.x = 307)
          : 2 == this.dataSource.length
          ? (this.list_system_message.x = 270)
          : 3 == this.dataSource.length
          ? (this.list_system_message.x = 237)
          : 4 == this.dataSource.length && (this.list_system_message.x = 200),
          (this.list_system_message.dataSource = this.dataSource);
      }),
      (t.prototype.dealSystemMessageState = function (e) {
        return 1 == e.state
          ? "comp/Home/image_message_system.png"
          : 2 == e.state
          ? "comp/Home/image_message_mychat.png"
          : 3 == e.state
          ? "comp/Home/image_message_email.png"
          : 6 == e.state
          ? "comp/Home/image_message_system.png"
          : void 0;
      }),
      (t.prototype.updateMessageRenderHandler = function (e, t) {
        e.getChildByName("image_message_tip");
      }),
      (t.prototype.onMessageDidClickAction = function (e) {
        if ("" != e.target.name) {
          for (
            var t = this.list_system_message.selectedIndex, i = 0;
            i < this.totalMsgArray.length;
            i++
          )
            console.log("this.totalMsgArray " + this.totalMsgArray[i]);
          var a = this.totalMsgArray[t].state;
          if (3 == a)
            this.totalMsgArray.splice(t, 1),
              EmailMainControllerView.openEmailView();
          else if (2 == a) {
            t = t - 1 > 0 ? t : 0;
            var o = this.privateArray[t].info_id;
            this.privateArray.length > 1
              ? this.privateArray.splice(t, 1)
              : (1 == this.privateArray.length &&
                  this.privateArray.splice(t, 1),
                this.totalMsgArray.splice(
                  this.list_system_message.selectedIndex,
                  1
                ));
            var n = { id: o };
            PrivateChatDialog.showPrivateMsgDialog(n),
              WebSocketService.send({ c: 1033, d: { roleid: o } });
          } else if (1 == a) {
            this.totalMsgArray.splice(t, 1);
            ((s = MessageViewController.openView()).y = 70),
              Laya.stage.addChild(s);
          } else if (6 == a) {
            this.totalMsgArray.splice(t, 1);
            var s = TeamMessageController.openView();
            (s.y = 35), Laya.stage.addChild(s);
          }
          this.showSystemMessage(this.totalMsgArray);
        }
      }),
      (t.prototype.baseInfoListener = function (e) {
        if (Global.isOldeVersion) {
          var t = Utils.dealRole_Type(e.roleType),
            i = Utils.transform(e.sex, "roleSexType");
          (this.nickName.text = e.name),
            (this.carceerLabel.text =
              Utils.dealTransAndLvl(e.roleType, e.lvl) + t),
            (this.head_icon.skin =
              "comp/hreoImg/ws" + this.setRoleImage(t, i) + ".png"),
            (this.silverLabel.text = 0 == e.silver ? "0" : e.silver),
            (this.goldLabel.text = 0 == e.gold ? "0" : e.gold),
            0 == e.tlzs
              ? ((this.user_tlz_Label.text = "体：" + e.tlz + "（开启）"),
                (this.user_tlz_Label.color = "#22f804"),
                (this.tlzVal = "0"))
              : ((this.user_tlz_Label.text = "体：" + e.tlz + "（关闭）"),
                (this.user_tlz_Label.color = "#cccccc"),
                (this.tlzVal = "1")),
            (this.expLabel.text = e.exp),
            (this.hpBar.value = e.hp / e.maxHp),
            (this.mpBar.value = e.mp / e.maxMp),
            (Global.roleId = e.id),
            (Global.roleName = e.name),
            (Global.roleLvl = e.lvl),
            (Global.roleSex = e.sex),
            (Global.roleHp = e.hp),
            (Global.roleMp = e.mp),
            (Global.roleType = e.roleType),
            (Global.roleVip = e.vip),
            (Global.vipBag = e.vipBag),
            (Global.superHK = e.superHK),
            e.gold > 999 && (this.btn_goldBrick.visible = !1),
            Global.roleLvl > Global.roleDefuLv &&
              WebSocketService.send({ c: 1425, d: { pageNum: 0 } }),
            this.isFirstComeIn && (Global.roleDefuLv = e.lvl),
            parseInt(e.lvl) >= 10 &&
              "三国新人" === e.name &&
              AXModifyNameDialog.shwoModifyView();
        }
      }),
      (t.prototype.onDidClickTiLiZhiAction = function () {
        "0" == this.tlzVal ? (this.tlzVal = "1") : (this.tlzVal = "0"),
          WebSocketService.send({ c: 3062, d: { s: this.tlzVal } });
      }),
      (t.prototype.setRoleImage = function (e, t) {
        return "文人" == e
          ? "女" == t
            ? 5
            : 2
          : "武士" == e
          ? "女" == t
            ? 4
            : 1
          : "异师" == e
          ? "女" == t
            ? 6
            : 3
          : 0;
      }),
      (t.prototype.onLoadHomeInfoListener = function (e) {
        var t,
          i = e.name,
          a = e.ss,
          o = i.indexOf("(");
        (t = o > 0 ? i.substr(0, o) : i),
          (this.navTitle.text = t),
          (Global.roleCity = e.name),
          (Global.siteType = e.type_id),
          (Global.roleCityId = e.id),
          e.type_id;
        var n = this.baseSetView.getChildByName("item7");
        a & Math.pow(2, 12) ? (n.visible = !0) : (n.visible = !1),
          ((n = this.baseSetView.getChildByName("item6")).visible = !!(4 & a)),
          ((n = this.baseSetView.getChildByName("item0")).visible = !!(8 & a)),
          ((n = this.baseSetView.getChildByName("item1")).visible = !!(
            128 & a
          )),
          ((n = this.baseSetView.getChildByName("item2")).visible = !!(16 & a)),
          ((n = this.baseSetView.getChildByName("item3")).visible = !!(
            256 & a
          )),
          ((n = this.baseSetView.getChildByName("item4")).visible = !!(4 & a)),
          ((n = this.baseSetView.getChildByName("item5")).visible = !!(
            512 & a
          ));
      }),
      (t.prototype.updateBaseNavHandlerFn = function (e, t) {
        if (!(t > this.list_baseNav.length)) {
          var i = e.getChildByName("btn_dialogue");
          1 == this.diaListArr[t].ap
            ? (i.skin = "comp/Home/btn_home_diago.png")
            : (i.skin = "comp/Home/btn_home_diago1.png");
        }
      }),
      (t.prototype.beginnersJoinSanGuoAction = function () {
        this.list_baseNav.selectedIndex = 0;
      }),
      (t.prototype.onLoadMySelfMoney = function (e) {
        if (0 == e.code) {
          var t = e.data;
          0 == t.money && (t.money = "0"),
            0 == t.gold && (t.gold = "0"),
            (this.silverLabel.text = t.money),
            (this.goldLabel.text = t.gold);
        }
      }),
      (t.prototype.onLoadTaskListDetailData = function (e) {
        if (Global.isOldeVersion) {
          e.code, e.data.yq || (e.data.yq = "");
          var t = e.data.yq.split("("),
            i = "";
          t.length > 1 && (i = "（" + t[1]), (this.taskArr = []);
          var a = {};
          (a = {
            task_name: { text: e.data.name + i },
            task_name_detail: { text: e.data.ts },
            site: e.data.site,
          }),
            this.taskArr.push(a),
            (this.list_task_tip_board.dataSource = this.taskArr);
        }
      }),
      (t.prototype.onTaskTipBoardData = function (e) {
        "" != e.target.name &&
          "btn_hit_task" == e.target.name &&
          ((this.taskDict =
            this.taskArr[this.list_task_tip_board.selectedIndex]),
          this.taskDict &&
            this.taskDict.site > 0 &&
            WebSocketService.send({
              c: 1437,
              d: { siteId: this.taskDict.site },
            }));
      }),
      (t.prototype.gotoDestination = function (e) {
        1436 == e.act_id
          ? WebSocketService.send({
              c: 1437,
              d: { siteId: this.taskDict.site },
            })
          : 0 == e.code
          ? (ToastView.toastView("已到达目的地"),
            Laya.stage.event("GameMainView", "person"))
          : ToastView.toastView(e.msg);
      }),
      (t.prototype.setupPersonTabView = function () {
        (this.baseInfoView.visible = !0),
          (this.baseNavView.visible = !0),
          (this.baseSetView.visible = !1),
          (this.baseMapVIew.visible = !1),
          MapCityAreaView.hiden(),
          (this.baseFunView.visible = !1);
      }),
      (t.prototype.setupfacilityTabView = function (e) {
        (this.baseInfoView.visible = !0),
          (this.baseNavView.visible = !1),
          (this.baseSetView.visible = !0),
          (this.baseMapVIew.visible = !1),
          MapCityAreaView.hiden(),
          (this.baseFunView.visible = !1);
      }),
      (t.prototype.setupMapTabView = function () {
        (this.baseInfoView.visible = !1),
          (this.baseNavView.visible = !1),
          (this.baseSetView.visible = !1),
          (this.baseMapVIew.visible = !0),
          Global.isFuBen
            ? MapCityAreaView.openMapView(2)
            : MapCityAreaView.changeMapView(),
          (this.baseFunView.visible = !1);
      }),
      (t.prototype.setupFeatureTabView = function () {
        (this.baseInfoView.visible = !0),
          (this.baseNavView.visible = !1),
          (this.baseSetView.visible = !1),
          (this.baseMapVIew.visible = !1),
          MapCityAreaView.hiden(),
          (this.baseFunView.visible = !0);
      }),
      (t.prototype.initSetPageView = function () {
        this.baseSetView
          .getChildByName("item0")
          .on(Laya.Event.CLICK, this, this.onBaseSetSelect1),
          this.baseSetView
            .getChildByName("item1")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect2),
          this.baseSetView
            .getChildByName("item2")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect3),
          this.baseSetView
            .getChildByName("item3")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect4),
          this.baseSetView
            .getChildByName("item4")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect5),
          this.baseSetView
            .getChildByName("item5")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect6),
          this.baseSetView
            .getChildByName("item6")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect7),
          this.baseSetView
            .getChildByName("item7")
            .on(Laya.Event.CLICK, this, this.onBaseSetSelect8);
      }),
      (t.prototype.initFunPageView = function () {
        this.btn_fun_zhuangtai.on(
          Laya.Event.CLICK,
          this,
          this.onDidClickFunctionAction
        ),
          this.btn_fun_wupin.on(Laya.Event.CLICK, this, this.onWuPinInfoFn),
          this.btn_fun_fujiang.on(
            Laya.Event.CLICK,
            this,
            this.onFuJiangDidClick
          ),
          this.btn_fun_zudui.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_haoyou.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_youjian.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_renwu.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_baoku.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_paihang.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_chongzhi.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_gonggao.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_leitai.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_jiaopai.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_VIP.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_denglu.on(
            Laya.Event.CLICK,
            this,
            this.onDengChuFunction
          ),
          this.btn_fun_yaoqing.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          ),
          this.btn_fun_jifen.on(
            Laya.Event.CLICK,
            this,
            this.onDidClickFunctionAction
          );
      }),
      (t.prototype.onBaseSetSelect1 = function (e) {
        var t = MedicalView.openMedicalView();
        (t.y = 0), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect2 = function (e) {
        var t = MoneyBankView.openView();
        (t.y = 35), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect3 = function (e) {
        var t = AXHouseRoom.openHouseView();
        (t.y = 0), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect4 = function (e) {
        var t = AXMarketView.openMarketView();
        (t.y = 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect5 = function (e) {
        var t = AXSquareView.openView();
        (t.y = 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect6 = function (e) {
        var t = MountsMainController.showMountsMainView();
        (t.y = 0), Laya.stage.addChild(t);
      }),
      (t.prototype.onBaseSetSelect7 = function (e) {
        var t = [
          { url: "res/atlas/comp.atlas", type: Laya.Loader.ATLAS },
          { url: "res/atlas/comp/battlefield.atlas", type: Laya.Loader.ATLAS },
          { url: "res/atlas/fight.atlas", type: Laya.Loader.ATLAS },
        ];
        Laya.loader.load(
          t,
          Laya.Handler.create(this, function () {
            var e = battlefield.showBattleView();
            e.pos(0, 35), Laya.stage.addChild(e);
          }),
          Laya.Handler.create(
            AXProgressBarView,
            AXProgressBarView.onLoadedRecourse,
            null,
            !1
          )
        );
      }),
      (t.prototype.onBaseSetSelect8 = function (e) {
        var t = EstateHomeView.showEstateHomeView(!0);
        t.pos(0, 70), Laya.stage.addChild(t);
      }),
      (t.prototype.onWuPinInfoFn = function () {
        var e = AXWearableGoodView.openView();
        e.pos(0, 35), Laya.stage.addChild(e);
      }),
      (t.prototype.onFuJiangDidClick = function () {
        var e = AXSubordinateView.openView();
        e.pos(0, 70), Laya.stage.addChild(e);
      }),
      (t.prototype.onLoadMySelfEstateData = function (e) {}),
      (t.prototype.onDidClickFunctionAction = function (e) {
        if ("item0" == e.target.name) DailySignView.showSignView();
        else if ("item3" == e.target.name) {
          var t = GroupTeamPageView.showGroupTeamView();
          t.pos(0, 35), Laya.stage.addChild(t);
        } else if ("item4" == e.target.name) {
          var i = AXRankListView.openView();
          i.pos(0, 35), Laya.stage.addChild(i);
        } else if ("item5" == e.target.name) {
          var a = MonthCardView.openMonthCardView();
          a.pos(0, 35), Laya.stage.addChild(a);
        } else if ("item6" == e.target.name)
          EmailMainControllerView.openEmailView();
        else if ("item7" == e.target.name) {
          var o = TaskboardView.openTaskView();
          o.pos(0, 35), Laya.stage.addChild(o);
        } else if ("item8" == e.target.name) {
          var n = new AXChallengeBattleView();
          n.pos(0, 35), Laya.stage.addChild(n);
        } else if ("item9" == e.target.name) {
          var s = FactionHomeView.showFactionHomeView();
          s.pos(0, 35), Laya.stage.addChild(s);
        } else if ("item10" == e.target.name) {
          var l = ActivityHomePageView.showActHomePageView();
          (l.y = 70), Laya.stage.addChild(l);
        } else if ("item11" == e.target.name) {
          var r = AXTreasureView.openView();
          r.pos(0, 70), Laya.stage.addChild(r);
        } else if ("item12" == e.target.name) {
          var d = AXNoticeBoardView.openView();
          d.pos(0, 35), Laya.stage.addChild(d);
        } else if ("item13" == e.target.name) {
          var c = VIPManagerView.openView();
          c.pos(0, 35), Laya.stage.addChild(c);
        } else if ("item15" == e.target.name) {
          var h = InviteView.openView();
          h.pos(0, 35), Laya.stage.addChild(h);
        } else if ("item16" == e.target.name) {
          var p = ScoredPointHomeView.showScoredPointHomeView();
          p.pos(0, 35), Laya.stage.addChild(p);
        }
      }),
      (t.prototype.onDengChuFunction = function () {
        NormalDialog.showNormalDialog(
          "您确定要退出此账号吗？",
          this,
          this.onLoginOutFun
        );
      }),
      (t.prototype.onLoginOutFun = function () {
        this.removeSelf(),
          Laya.stage.event("GameMainView", { code: "close" }),
          Laya.stage.event("HomePageView", { code: "close" }),
          SelectRoleView.open();
      }),
      (t.prototype.onBaseNavSelect = function (e) {
        if ("" != e.target.name) {
          if (
            ((this.npcObj = this.list_baseNav.selectedItem),
            "btn_dialogue" == e.target.name)
          )
            if (1 == this.npcObj.typeId) {
              var t = {
                code: "start_fightnpc_from_homepage",
                data: this.npcObj,
              };
              Laya.stage.event("GameMainView", t);
            } else {
              if (2 == this.npcObj.typeId) {
                if (7e3 == this.npcObj.id) {
                  var i = NPCFuBenView.showFuBenNPCView();
                  return i.pos(0, 0), void Laya.stage.addChild(i);
                }
                return void (CommonActivityView.isThisNpc(this.npcObj.id)
                  ? CommonActivityView.open(this.npcObj.id)
                  : AddSkillCountView.isThisNpc(this.npcObj.id)
                  ? AddSkillCountView.open()
                  : CommunicateDialog.showCommunicationDialog(this.npcObj));
              }
              if (3 == this.npcObj.typeId)
                return void CommunicateDialog.showCommunicationDialog(
                  this.npcObj
                );
            }
          else NPCDetailDialog.showNPCDialog(this.npcObj);
          Laya.timer.once(2e3, this.list_baseNav, function () {
            this.selectedIndex > -1 && (this.selectedIndex = -1);
          });
        }
      }),
      (t.prototype.onMyselfInfoFn = function () {
        var e = UserInfoView.openView();
        e.pos(0, 35), Laya.stage.addChild(e);
      }),
      (t.prototype.onDidClickMapFn = function (e) {}),
      (t.prototype.setupMapViewActionFn = function () {}),
      (t.prototype.onMapDidClickWeiFn = function () {
        (this.btn_map_WeiP.selected = !0),
          Laya.timer.once(150, this, function () {
            (this.btn_map_WeiP.selected = !1), MapCityAreaView.openMapView(100);
          });
      }),
      (t.prototype.onMapDidClickShuFn = function () {
        (this.btn_map_shuP.selected = !0),
          Laya.timer.once(150, this, function () {
            (this.btn_map_shuP.selected = !1), MapCityAreaView.openMapView(19);
          });
      }),
      (t.prototype.onMapDidClickWuFn = function () {
        (this.btn_map_WuP.selected = !0),
          Laya.timer.once(150, this, function () {
            (this.btn_map_WuP.selected = !1), MapCityAreaView.openMapView(43);
          });
      }),
      (t.prototype.onLoadImageFuJiangAction = function (e) {
        this.loadFuJiangImagePic(),
          "fujiangone" == e.target.name ||
            "fujiangtwo" == e.target.name ||
            e.target.name;
      }),
      (t.prototype.onGetJinValueAction = function () {
        var e = PuranceView.openView();
        e.pos(0, 40), Laya.stage.addChild(e);
      }),
      (t.prototype.loadFuJiangImagePic = function () {
        var e = AXSubordinateView.openView();
        e.pos(0, 70), Laya.stage.addChild(e);
      }),
      (t.prototype.eventHandler = function (e) {
        Global.isOldeVersion &&
          e &&
          ("refreshMoney" == e
            ? WebSocketService.send({ c: 1451 })
            : "moeny" == e.code && e.data
            ? ((this.silverLabel.text = e.data.money),
              (this.goldLabel.text = e.data.gold),
              e.data.gold > 999 && (this.btn_goldBrick.visible = !1))
            : "exp" == e || "hp" == e
            ? ((this.isFirstComeIn = !1), WebSocketService.send({ c: 300 }))
            : "username" == e.code && e.data
            ? (this.nickName.text = e.data)
            : "site" == e
            ? (WebSocketService.send({ c: 100 }),
              WebSocketService.send({ c: 200 }))
            : "cortege" == e
            ? WebSocketService.send({ c: 320 })
            : "npc" == e ||
              "update_task" == e ||
              ("update_task_view" == e
                ? this.initTaskDiv()
                : "setAutoFight" == e.code
                ? (this.isAutoFight = e.isAuto)
                : "loadingFuben" == e
                ? (WebSocketService.send({
                    c: 5,
                    d: { roleId: Global.roleId },
                  }),
                  WebSocketService.send({ c: 200 }),
                  (Global.isFuBen = !1))
                : "close" == e.code
                ? this.removeSelf()
                : "week_notice" == e.code &&
                  ("0" == e.weekNotice
                    ? (this.label_tips_gonggao.visible = !1)
                    : (this.label_tips_gonggao.visible = !0))));
      }),
      (t.prototype.initTaskDiv = function () {
        var e = "item_" + Global.roleId;
        "task_off" == laya.net.LocalStorage.getItem(e)
          ? ((this.image_taskView.visible = !1),
            (this.list_task_tip_board.visible = !1))
          : ((this.image_taskView.visible = !0),
            WebSocketService.send({ c: 1153, d: { mid: 0 } }),
            (this.list_task_tip_board.visible = !0));
      }),
      (t.prototype.synReq = function (e) {
        WebSocketService.send(e.data);
      }),
      (t.prototype.onGetXinShouLiBaoAction = function () {
        "396" == this.canUseLiBaoID
          ? WebSocketService.send({ c: 6067 })
          : WebSocketService.send({ c: 1904, d: { gid: this.canUseLiBaoID } }),
          (this.btn_xinshoulibao.visible = !1),
          (this.image_xinshoulibao.visible = !1),
          Laya.stage.event("HomePageView", "refreshMoney");
      }),
      (t.prototype.onLoadXinShouLiBaoFn = function (e) {
        if (0 == e.code)
          for (var t = e.data, i = 0; i < t.length; i++) {
            var a = t[i];
            (this.canUseLiBaoID = a.id),
              this.dealLiBaoImage(a.id),
              Global.roleLvl >= 50
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id &&
                    507 != a.id &&
                    508 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 40
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id &&
                    507 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 30
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id &&
                    506 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 20
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id &&
                    505 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 15
                ? (396 != a.id &&
                    501 != a.id &&
                    502 != a.id &&
                    503 != a.id &&
                    504 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 10
                ? (396 != a.id && 501 != a.id && 502 != a.id && 503 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 5
                ? (396 != a.id && 501 != a.id && 502 != a.id) ||
                  this.isShowXinShouLiBao()
                : Global.roleLvl >= 1 &&
                  ((396 != a.id && 501 != a.id) || this.isShowXinShouLiBao());
          }
      }),
      (t.prototype.isShowXinShouLiBao = function () {
        (this.btn_xinshoulibao.visible = !0),
          (this.image_xinshoulibao.visible = !0);
      }),
      (t.prototype.dealLiBaoImage = function (e) {
        this.image_xinshoulibao.skin =
          396 == e
            ? "comp/image_xinshoulibao.png"
            : "comp/image_xinshoulibao_dawa.png";
      }),
      (t.prototype.onLoadGroupTeamDataFn = function (e) {
        0 == e.code &&
          Laya.stage.event("ChatRoomView", {
            name: "group_team",
            data: e.data,
          });
      }),
      (t.prototype.onLoadUserTaoWaDataFn = function (e) {
        ToastView.toastView(e.msg);
      }),
      (t.prototype.onLoadNewRoleUseAction = function (e) {
        0 == e.code && ToastView.toastView(e.msg);
      }),
      (t.prototype.onQuitFuBenAction = function () {
        WebSocketService.send({ c: 1806 });
      }),
      (t.prototype.onLoadQuitFuBenData = function (e) {
        (Global.isFuBen = !1), this.initTaskDiv();
      }),
      t
    );
  })(ui.HomePageViewUI);
